import os,sys,requests
p=os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))))
p=os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(p))))
p=p+os.sep+'_base_tool'+os.sep+'python'
sys.path.append(p)
from base_class1_0 import base_class # type: ignore
class a_1_0_1_2_0(base_class):
    def init(self):
        self.topic_flag=False#top是否成功监听
    def run(self,**kwargs):
        # 目标URL
        host=kwargs['host']
        port=kwargs['port']
        url = f'http://{host}:{port}/'
        # 请求的body参数
        body_params = {
            'type_param': kwargs.get("db_name"),
            'data_param': kwargs.get("info")
        }
        # 发送POST请求
        response = requests.post(url, json=body_params)
        return {"flag":kwargs.get("flag"),"res":response.json()}
        # 打印响应状态码和响应内容
        print('Status Code:', response.status_code)
        print('Response Content:', response.json())